//
//  OnlineUserCell.m
//  RSW.IOS
//
//  Created by zhaiqiuqiu on 16/12/15.
//  Copyright © 2016年 com.xtion.crm. All rights reserved.
//

#import "OnlineUserCell.h"

@interface OnlineUserCell()
{
    HeadImageView *_headImageView;
}
@end

@implementation OnlineUserCell

-(id)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithReuseIdentifier:reuseIdentifier];
    
    _headImageView = [[HeadImageView alloc]initWithFrame:CGRectMake(0,0, 40, 40)];
    _headImageView.headImage = [UIImage imageNamed:@"img_defaulthead.png"];
    [self.contentView addSubview:_headImageView];
    
    CGSize s = [NSString charSizeWithSystemFontSize:16];
    _userName = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, s.width*10, s.height)];
    _userName.backgroundColor = [UIColor clearColor];
    _userName.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:_userName];
    
    s = [NSString charSizeWithSystemFontSize:13];
    _mobilePhoe = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, s.width*10, s.height)];
    _mobilePhoe.backgroundColor = [UIColor clearColor];
    _mobilePhoe.font = [UIFont systemFontOfSize:13];
    _mobilePhoe.textColor = [UIColor colorWithHex:mcrmSAASUISkinColorTextStyle9b9b9bColor];
    [self.contentView addSubview:_mobilePhoe];
    
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    _headImageView.origin = CGPointMake(10, 0);
    _headImageView.centerY = self.contentView.height/2;
    
    _userName.origin = CGPointMake(_headImageView.right + 10, 10);
    _mobilePhoe.origin = CGPointMake(_headImageView.right + 10, _userName.bottom + 3);
}

-(void)setLogoUrl:(UIImage *)logoUrl
{
    _headImageView.headImage = logoUrl;
}
@end
